﻿/**
 * @author sminutoli
 * version 1.0
 */
import com.dinmax.flash.utilities.movieclip.MovieClipUtils
import com.dinmax.flash.utilities.date.DateUtils
import com.dinmax.flash.draw.cabeza.ScrollCabeza

class com.dinmax.flash.central.bridge.WINDOWLogBridge
extends com.dinmax.flash.draw.cabeza.WindowCabeza {
	
	private static var LINK_ID:String = "WindowLogItem";
	
	public function drawItem(time:Date, type:String, description:String):MovieClip {
		var clip:MovieClip = super.drawItem(WINDOWLogBridge.LINK_ID);
		clip.gotoAndStop(type);
		//clip.txt_date.text = time.getDate()+"-"+time.getMonth()+"-"+time.getFullYear()+" | "+time.getHours()+":"+time.getMinutes();
		clip.txt_date.text = DateUtils.dateToString(time, DateUtils.date_DD_MM_AA, "-");
		clip.txt_date.text += " | ";
		clip.txt_date.text += DateUtils.hourToString(time, DateUtils.hour_HH_MM);
		clip.txt_description.text = description;
		this.getScrollV().setStep(clip._height);
		if(this.getScrollV().getState() == ScrollCabeza.ENABLED){
			this.getScrollV().setScrollPos(100);
		};
		return clip;
	};
	
	private function initScrollV():Void {
		super.initScrollV();
		if(this.getScrollV().getState() == ScrollCabeza.ENABLED){
			this.getScrollV().setScrollPos(100);
		};
		this.getScrollV().setMouseWheel(true, this);
	};
		
}